import { profileType, profileUseType } from '@/types/data';
import { profileAction } from '@/types/store';
type initType = {
  profile: profileType;
  profileUse: profileUseType;
};
const init: initType = {
  profile: {} as profileType,
  profileUse: {} as profileUseType,
};
export default function profile(state = init, action: profileAction): initType {
  switch (action.type) {
    case 'profile':
      return { ...state, profile: action.payload };
    case 'profile/use':
      return { ...state, profileUse: action.payload };
    default:
      return state;
  }
}
